package cn.schoolwow.flow.monitor.entity;

import cn.schoolwow.ams.domain.annotation.AMSFieldType;
import cn.schoolwow.quickdao.annotation.*;
import com.alibaba.fastjson.JSONObject;

import java.time.LocalDateTime;

@Comment("配置参数")
@UniqueField(columns = {"className"})
public class ConfigParameter {
    @Id
    private long id;

    @Comment("参数名称")
    @Constraint(notNull = true)
    private String name;

    @Comment("参数类型")
    @Constraint(notNull = true)
    private String className;

    @Comment("实例名称")
    @Constraint(notNull = true)
    private String beanName;

    @Comment("参数值")
    private JSONObject value;

    @Comment("参数说明")
    @Constraint(notNull = true)
    @AMSFieldType("textarea")
    private String comment;

    @Comment("是否启用(0:禁用,1:启用)")
    @Constraint(notNull = true,defaultValue = "1")
    private Integer enable;

    @TableField(createdAt = true)
    private LocalDateTime createdAt;

    @TableField(updatedAt = true)
    private LocalDateTime updatedAt;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public JSONObject getValue() {
        return value;
    }

    public void setValue(JSONObject value) {
        this.value = value;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}
